#include<iostream>
#include<string>
#include<unordered_map>
using namespace std;
const int N = 1e6 + 10;
int n;
int primes[N];
bool st[N];
int idx;
unordered_map<int, int>mp;
void fun()
{
	for (int i = 2; i <= n; i++) {
		if (!st[i]) {
			mp[i] = 1;
			for (int j = i * 2; j <= n; j += i) {
				st[j] = 1;
			}
		}
	}
}
int main()
{
	cin >> n;
	fun();
	int ans = 0;
	for (int i = 0; i < n; i++) {
		int x;
		scanf_s("%d", &x);
		if (mp[x])ans++;
	}
	//cout << ans << " ans" << endl;
	int ans2 = n - ans;
	cout <<  ans2 - ans << endl;
	return 0;
}